#ifdef ONLINE_JUDGE
    #include<stdio.h>
    #include<stdlib.h>
    #include<ctype.h>
    #define INPUT stdin
    int main() {
#else
    #include"header.h"
    #define INPUT fptIn
    int acm_00494() {
        printf("--ACM 00494 begin here--\n");
        FILE *fptIn = fopen("Resource/acm_00494.txt","r");
        if ( fptIn == NULL )
        {
            printf("File acm_00494.txt load fail.\n");
            printf("Program will exit.\n");
            return EXIT_FAILURE;
        }
#endif
    char charTmp;
    int wordNum = 0;
    while( charTmp != EOF ){
        charTmp = fgetc(INPUT);
        while( isalpha( charTmp ) ){
            wordNum = wordNum + 1 ;
            charTmp = fgetc(INPUT);
            while( isalpha( charTmp ) ){
                charTmp = fgetc(INPUT);
            }
        }
        if( charTmp == '\n' || charTmp == EOF){
            if( wordNum > 0 ){//Avoid the last line may no word
                printf("%d\n",wordNum);
            }
            wordNum = 0;
        }
    }
    #ifndef ONLINE_JUDGE
        printf("--ACM acm_00494 end here--\n");
        fclose(fptIn);
    #endif
    return 0;
}
